package com.example.tests;

import java.util.Set;

import org.testng.annotations.Test;

public class ContactModificationTests extends TestBase {
	
	@Test
	public void testValidContactCanBeModified() throws Exception {
		int i = 2;
		Set<ContactObject> oldList = app.getContactHelper().getContacts();
		ContactObject targetContact = app.getContactHelper().getContactWithNumber(i);
		ContactObject validContact = new ContactObject()
			.setFirstName("1111")
			.setLastName("1111")
			.setAddress("1111")
			.setHome("11111")
			.setMobile("11111")
			.setWork("11111")
			.setEmail("1111@1111.ru")
			.setEmail2("1111@1111.com")
			.setBday("4")
			.setBmonth("March")
			.setByear("1982")
			.setAddress2("111111")
			.setPhone2("11");
		app.getContactHelper().modifyContact(i, validContact);
		Set<ContactObject> newList = app.getContactHelper().getContacts();
		ContactObject modifiedContact = app.getContactHelper().getContactWithNumber(i);
		verifyContactModified(oldList, targetContact, modifiedContact, newList);
	}

}
